/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.lsp.obey;

import junit.framework.Assert;
import za.ac.cput.lsp.obey.service.internal.CalculatorImpl;
import org.springframework.context.ApplicationContext;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import za.ac.cput.inheritence.service.internal.EmployeePrintImpl;
import za.ac.cput.lsp.obey.config.CalcConf1;

/**
 *
 * @author Jameel
 */
public class CalcJUnitTest1 {
    
    private static ApplicationContext ctx;
    private static CalculatorImpl calc;
    
    public CalcJUnitTest1() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        ctx = new AnnotationConfigApplicationContext(CalcConf1.class);
        calc = (CalculatorImpl)ctx.getBean("calc1");
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }
    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
    @Test
    public void calc() {
        CalculatorImpl myCalc = new CalculatorImpl();
        
        Assert.assertEquals(15, myCalc.add(5, 10));               
    }
}
